pub enum ConversionEnum {
    TWO,
    EIGHT,
    TEN,
    SIXTHEEN,
}

pub struct Conver {
    prefix: String,
    device: usize,
    data: Vec<char>,
}

impl Conver {
    pub fn get_device(&self) -> usize {
        self.device
    }
    pub fn get_prefix(self) -> String {
        self.prefix
    }
    pub fn get_data(&self, index: usize) -> char {
        self.data[index]
    }
}

impl ConversionEnum {
    pub fn new(t: ConversionEnum) -> Conver {
        match t {
            ConversionEnum::TWO => Conver {
                prefix: "".to_string(),
                device: 2,
                data: vec!['0', '1'],
            },
            ConversionEnum::EIGHT => Conver {
                prefix: "0x".to_string(),
                device: 8,
                data: vec!['0', '1', '2', '3', '4', '5', '6', '7'],
            },
            ConversionEnum::TEN => Conver {
                prefix: "".to_string(),
                device: 10,
                data: vec!['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
            },
            ConversionEnum::SIXTHEEN => Conver {
                prefix: "0x".to_string(),
                device: 16,
                data: vec![
                    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E',
                ],
            },
        }
    }
}
